<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<!DOCTYPE html >
<html>
<head>
<!-- <script type="text/javascript" src="plug-in/jquery/jquery-1.8.3.min.js"></script> -->
<script type="text/javascript" src="plug-in/uploadify/jquery.uploadify-3.1.min.js"></script>
<%--<script type="text/javascript" src="webpage/com/zybk/file_upload/fileUpload.js"></script>--%>
<link rel="stylesheet" href="plug-in/uploadify/css/uploadify.css" type="text/css" />
<script type="text/javascript">

$(function(){
	$("#file_upload").uploadify({
		buttonText : '上传文件',
		auto : true,
		progressData : 'speed',
		multi : true,
		height : 20,
		width : 60,
		overrideEvents : ['onDialogClose'],
		fileTypeDesc : '文件格式:',
		queueID : 'instructionfile',
		fileTypeExts : '*.xlsx;',
		fileSizeLimit : '15MB',
		swf : 'plug-in/uploadify/uploadify.swf',	
		uploader : 'uploadEquipmentController.do?importExcelByRenewal',
		onUploadStart : function(file) { 
			lockmask(true,'请稍等,导入中...');
		},
		onUploadSuccess : function(file,responseData, response) {
			lockmask(false);
			var data = $.parseJSON(responseData);
			console.log(data);
			tip(data.msg);
			
		},onFallback : function(){
			tip("您未安装FLASH控件，无法上传图片！请安装FLASH控件后再试");
		},onSelectError : function(file, errorCode, errorMsg){
			switch(errorCode) {
				case -100:
					tip("上传的文件数量已经超出系统限制的"+$('#instruction').uploadify('settings','queueSizeLimit')+"个文件！");
					break;
				case -110:
					tip("文件 ["+file.name+"] 大小超出系统限制的"+$('#instruction').uploadify('settings','fileSizeLimit')+"大小！");
					break;
				case -120:
					tip("文件 ["+file.name+"] 大小异常！");
					break;
				case -130:
					tip("文件 ["+file.name+"] 类型不正确！");
					break;
				};
		},
		onError : function(event,queueId,fileObj,errorObj){
			console.log(errorObj.type + " : " + errorObj.info);
		}
	});
});
</script>
</head>
<body style="overflow-y: hidden" scroll="no">
 <form  enctype="multipart/form-data" >
	<span id="file_upload"></span>
	</form>
</body>
</html>